<?php
namespace Home\Model;
use Think\Model;
class BrandModel extends Model {

	protected $trueTableName = 'my_brand';

	public function all()
	{
		$where['status'] = 1;
		$field = 'id,name';
		return $this->where($where)->field($field)->select();
	}

	public function getNameById($id)
	{
		$where['id'] = $id;
		return $this->where($where)->field('name')->find();
	}

}